#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QTextToSpeech>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}

//点击1
void MainWindow::on_pushButton_clicked()
{
    QTextToSpeech *speech=new QTextToSpeech(this);
    //文字转语音
    speech->say("你按了数字1");
}
